package handler.v2;

import handler.v1.InitLeaveHandler;

public class HandlerV2Test {
    public static void main(String[] args) {
        Param param = new Param();
        param.setNumber(1);
        InitFeeCalcHandler initFeeCalcHandler = new InitFeeCalcHandler();
        initFeeCalcHandler
                .addRight(new NewFeeCalcHandler(param1 ->{
                    Result result = new Result();
                    result.setResult(param1.getNumber() * 100);
                    return result;
                }))
                .addRight(new VIPFeeCalcHandler(param1 -> {
                    Result result = new Result();
                    result.setResult(param1.getNumber() + 11);
                    return result;
                }));
        Result result = initFeeCalcHandler.calc(param);
        System.out.println(result.getResult());
    }
}
